package com.qianli.cashmama.trade.client.bill.request;

import com.fqgj.common.api.ParamsObject;
import com.fqgj.exception.common.ApplicationException;
import com.qianli.cashmama.trade.client.vo.DiscountListVO;
import org.apache.commons.lang.StringUtils;

import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/25
 * Time: 下午3:17
 */
public class TradePayRequest extends ParamsObject {
    /**
     * 用户code
     */
    private String userCode;

    /**
     * 交易code
     */
    private String tradeNo;

    /**
     * 现金金额
     */
    private String capital;

    /**
     * 支付发起时间
     */
    private Date payDate;

    /**
     * 支付流水号
     */
    private String payBizNo;

    /**
     * 支付渠道
     */
    private String paidChannel;

    /**
     * 支付银行卡,也可以是支付宝号码
     */
    private String bankNo;

    /**
     * 优惠列表
     */
    private List<DiscountListVO> discountList;


    @Override
    public void validate() {
        if (StringUtils.isEmpty(userCode) || StringUtils.isEmpty(tradeNo) || StringUtils.isEmpty(capital)
                || StringUtils.isEmpty(payBizNo) || StringUtils.isEmpty(paidChannel) || StringUtils.isEmpty(bankNo)) {
            throw new ApplicationException("Parameter error");
        }
    }

    public String getBankNo() {
        return bankNo;
    }

    public TradePayRequest setBankNo(String bankNo) {
        this.bankNo = bankNo;
        return this;
    }

    public String getPayBizNo() {
        return payBizNo;
    }

    public TradePayRequest setPayBizNo(String payBizNo) {
        this.payBizNo = payBizNo;
        return this;
    }

    public String getPaidChannel() {
        return paidChannel;
    }

    public TradePayRequest setPaidChannel(String paidChannel) {
        this.paidChannel = paidChannel;
        return this;
    }

    public List<DiscountListVO> getDiscountList() {
        return discountList;
    }

    public TradePayRequest setDiscountList(List<DiscountListVO> discountList) {
        this.discountList = discountList;
        return this;
    }

    public Date getPayDate() {
        return payDate;
    }

    public TradePayRequest setPayDate(Date payDate) {
        this.payDate = payDate;
        return this;
    }

    public String getCapital() {
        return capital;
    }

    public TradePayRequest setCapital(String capital) {
        this.capital = capital;
        return this;
    }

    public String getUserCode() {
        return userCode;
    }

    public TradePayRequest setUserCode(String userCode) {
        this.userCode = userCode;
        return this;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public TradePayRequest setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
        return this;
    }
}
